package org.zxp.designpattern.chain;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2019-08-29 15:26
 **/
public class TestChain {
    public static void main(String[] args) throws Exception {
        //构建责任链
        AbstractIntercept intercept1 = new Intercept1();
        AbstractIntercept intercept2 = new Intercept2();
        intercept1.setNext(intercept2);

        intercept1.Intercept(4);

        intercept1.Intercept(5);
    }
}
